Skip to content

Instantly share code, notes, and snippets.

div.field_with_errors label{color:#d4524b !important}div.field_with_errors input:not(.custom-tailwind){border:2px solid #d4524b !important}div.field_with_errors+.input-wrapper{border:2px solid #d4524b !important}[data-controller=character-count].warn .count-label{color:#f5a623}[data-controller=character-count].alert .count-label{color:#d4524b}fieldset{border:none}fieldset label{display:block;color:#333;font-size:18px;font-weight:bold;margin:40px 0 6px 0}fieldset label.p-0{padding:0}fieldset label.m-0{margin:0}fieldset label.radio_description{display:inline;color:#666;font-weight:normal;margin:0}fieldset label small{font-weight:normal;color:#999;padding-left:10px}fieldset label small.warn{color:#f5a623}fieldset label small.alert{color:#d4524b}fieldset i{color:#999;display:block;font-size:14px;font-style:normal;padding:7px 0 0 2px}input[type=text],input[type=email],input[type=number],input[type=password],fieldset input,fieldset textarea,fieldset select{border:2px solid #434459;border-radius:5px;box-sizing:borde
@sohamkamani
sohamkamani / rsa.js
Last active May 8, 2024 19:32
An example of RSA Encryption implemented in Node.js
const crypto = require("crypto")
// The `generateKeyPairSync` method accepts two arguments:
// 1. The type ok keys we want, which in this case is "rsa"
// 2. An object with the properties of the key
const { publicKey, privateKey } = crypto.generateKeyPairSync("rsa", {
// The standard secure default length for RSA keys is 2048 bits
modulusLength: 2048,
})

This book is all about patterns for doing ML. It's broken up into several key parts, building and serving. Both of these are intertwined so it makes sense to read through the whole thing, there are very many good pieces of advice from seasoned professionals. The parts you can safely ignore relate to anything where they specifically use GCP. The other issue with the book it it's very heavily focused on deep learning cases. Not all modeling problems require these. Regardless, let's dive in. I've included the stuff that was relevant to me in the notes.

Most Interesting Bullets:

  • Machine learning models are not deterministic, so there are a number of ways we deal with them when building software, including setting random seeds in models during training and allowing for stateless functions, freezing layers, checkpointing, and generally making sure that flows are as reproducible as possib
@morningreis
morningreis / proton_opn_wg.md
Created December 16, 2022 21:26
OPNsense + ProtonVPN + Wireguard Configuration Guide

OPNsense + ProtonVPN + Wireguard

Published: 16 December 2022

Reference: https://docs.opnsense.org/manual/how-tos/wireguard-selective-routing.html

Goal: Set up one or more Wireguard connections from ProtonVPN on OPNsense, with policy based routing, and optional Killswitch.

I'm writing this guide first as a reference for my future self for when I inevitably forget how to do this, but also to help others out. I found there were not many guides on this specific configuration, particularly not with multiple concurrent connections, and these were some steps which were not at all obvious. I did begin with the guide in the official OPNsense documentation, but even that was missing info to make ProtonVPN work. If you are a pfSense user, it is very similar to OPNsense, and you should be able to follow along with some success, but I have not tested it myself.

@DzeryCZ
DzeryCZ / ReadingHelmResources.md
Last active May 8, 2024 19:31
Decoding Helm3 resources in secrets

Helm 3 is storing description of it's releases in secrets. You can simply find them via

$ kubectl get secrets
NAME                                                TYPE                                  DATA   AGE
sh.helm.release.v1.wordpress.v1                     helm.sh/release.v1                    1      1h

If you want to get more info about the secret, you can try to describe the secret

$ kubectl describe secret sh.helm.release.v1.wordpress.v1
import SwiftUI
import Combine
protocol RandomNumberServiceProtocol {
func makeRandomInt() -> Int
}
final class RandomNumberService: RandomNumberServiceProtocol {
// MARK: - RandomNumberServiceProtocol
func makeRandomInt() -> Int {
@AlessandraSozzi
AlessandraSozzi / index.html
Last active May 8, 2024 19:26
D3 drag and drop: manually reorder rows and columns of a matrix
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<style>
.background {
fill: #fff;
}
rect {
stroke: #fff;
@brentjanderson
brentjanderson / Howto.md
Created February 20, 2018 17:55
SSH Tunneling with Firefox

Sometimes it is useful to route traffic through a different machine for testing or development. At work, we have a VPN to a remote facility that we haven't bothered to fix for routing, so the only way to access a certain machine over that VPN is via an SSH tunnel to a machine that is reachable over the VPN. Other times, I have used this technique to test internet-facing requests against sites I am developing. It is pretty easy, and if you don't use firefox regularly, you can treat Firefox as your "Proxy" browser and other browsers can use a normal configuration (Although you can also configure an entire system to use the proxy, other articles exists that discuss this potential).

  1. Open a terminal
@jjb
jjb / file.md
Last active May 8, 2024 19:22
Using Jemalloc 5 with Ruby.md

For years, people have been using jemalloc with ruby. There were various benchmarks and discussions. Legend had it that Jemalloc 5 didn't work as well as Jemalloc 3.

Then, one day, hope appeared on the horizon. @wjordan offered a config for Jemalloc 5.

Ubuntu/Debian

FROM ruby:3.1.2-bullseye
RUN apt-get update ; \